{template header}

<script>
$(document).ready(function() {

//选择一级区域
$('#cateid').change(function(){
	$("#select2").html('<img src="'+siteUrl+'public/images/loading.gif" />');
	var cateid = $(this).children('option:selected').val();  //弹出select的值
	
	if(cateid==0){
		$("#select2").html('');
		$("#select3").html('');
	}else{
		$("#select3").html('');
		$.ajax({
			type: "GET",
			url:  "{SITE_URL}index.php?app=study&ac=cate&ts=two&cateid="+cateid,
			success: function(msg){
				$("#select2").html(msg);
				
				//选择二级区域
				$('#cateid2').change(function(){
					$("#select3").html('<img src="'+siteUrl+'public/images/loading.gif" />');
					var cateid2 = $(this).children('option:selected').val();  //弹出select的值
					
					if(cateid2 == 0){
						$("#select3").html('');
					}else{
					
						//ajax
						$.ajax({
							type: "GET",
							url:  "{SITE_URL}index.php?app=study&ac=cate&ts=three&cateid2="+cateid2,
							success: function(msg){
								$('#select3').html(msg);
							}
						});
					
					}

				});
				
			}
		});
	
	}
	
});

});
</script>


<div class="container">


	<ol class="breadcrumb">
		<li><a href="{tsUrl('study')}">课程</a></li>
		<li><a href="{tsUrl('study','show',array('id'=>$strStudy['studyid']))}">{$strStudy[studyname]}</a> </li>
		<li class="active">管理</li>
	</ol>



	<div class="panel panel-default">
		<div class="panel-body">


	{template edit_menu}



<div class="row">

    <div class="col-md-2"></div>
    <div class="col-md-8">


        <form method="POST" action="{SITE_URL}index.php?app=study&ac=edit&ts=basedo" enctype="multipart/form-data">

            <div class="form-group">
                <label>课程标题</label>
                <input type="text" class="form-control" name="studyname" value="{$strStudy['studyname']}">
            </div>

            <div class="form-group">
                <label>课程介绍</label>
				<div id="tseditor"></div>
				<div style="display: none;">
					<textarea name="studydesc" >{$strStudy['studydesc']}</textarea>
				</div>
				<!--<textarea name="content" id="tseditor"></textarea>-->

            </div>


            <div class="form-group">
                <label>课程价格</label>
                <input type="text" class="form-control" name="price" value="{$strStudy['price']}">
            </div>

            <div class="form-group">
                <label>课程分类</label>

                <p>{$strStudy['onecate']['catename']} - {$strStudy['twocate']['catename']}</p>

                <select  id="cateid" name="cateid">
                    <option value="0">请选择一级分类</option>
                    {loop $arrCates $key $item}
                    <option value="{$item['cateid']}">{$item['catename']}</option>
                    {/loop}
                </select>

                <span id="select2"></span>
                <span id="select3"></span>

            </div>


            <div class="form-group">
                <label>课程封面图片：</label>

                <p>
                <img src="{if $strStudy[photo]}{php echo tsXimg($strStudy[photo],'study','255','140',$strStudy[path],1)}?v={php echo rand()}{else}{SITE_URL}app/study/skins/default/kecheng.gif{/if}" />

                    <br>

                    <input type="file" name="photo" /> (支持jpg,png,gif，建议大小：500px*275px)

                </p>

            </div>


            <input type="hidden" name="studyid" value="{$strStudy['studyid']}" />
            <button type="submit" class="btn btn-success btn-lg">修改课程</button>
        </form>


    </div>
    <div class="col-md-2"></div>

</div>





</div>
	
	
	</div>



</div>


</section>

{php doAction('tseditor')}
{template footer}

